package tech.xiaozai.exam.mapstruct;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import tech.xiaozai.exam.bo.MenuBO;
import tech.xiaozai.exam.po.SysPermission;

import java.util.List;

/**
 * @author xiaozai
 * @version 1.0
 * @date 2020-09-21 09:47
 */

@Mapper
public interface MenuMapStruct {

    MenuMapStruct me = Mappers.getMapper(MenuMapStruct.class);

    /**
     *  ...
     * @param permission
     * @return
     */
    @Mapping(target = "children",ignore = true)
    MenuBO toBo(SysPermission permission);

    /**
     *   ...
     * @param permissionList
     * @return
     */
    List<MenuBO> toBoList(List<SysPermission> permissionList);

}
